Skip to content

Isolate immutable Cloudflare public reads from PHP-WASM#2113

Merged
chubes4 merged 1 commit into
mainfrom
fix/2112-isolate-public-reader
Jul 26, 2026
Merged

Isolate immutable Cloudflare public reads from PHP-WASM#2113
chubes4 merged 1 commit into
mainfrom
fix/2112-isolate-public-reader

Conversation

@chubes4

@chubes4 chubes4 commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an opt-in R2-only Cloudflare public-reader Worker that cannot fall through to PHP-WASM, SQLite, D1, coordinators, or mutation execution
  • introduce explicit building and complete publication states; the isolated reader accepts only current-schema, non-empty complete publications while the existing mutation Worker retains legacy publication compatibility
  • serve immutable page snapshots, canonical theme/plugin assets, uploads, and WordPress core assets through revision- or content-addressed Worker cache identities
  • return bounded 404/503 responses for absent routes and incomplete publications instead of triggering 45-103 second dynamic WordPress requests

Root Cause

The deployed publication contained / but not its linked routes. servePublishedWordPressPage() returned null on a publication miss, so public navigation entered the 23.3 MiB PHP-WASM mutation Worker. Even publication and asset hits shared that monolithic Worker entrypoint.

This PR adds a separate 468.68 KiB raw / 115.52 KiB gzip read-only bundle with only an R2 binding. It does not replace or alter intentional dynamic execution through the existing mutation endpoint. Deployment and destination-specific routing remain out of scope.

Compatibility

  • Existing mutation Worker callers and dynamic WordPress behavior remain available.
  • Publication schemas v1-v3 remain readable by the existing compatibility validator.
  • The isolated reader intentionally requires a v4 complete publication, so an old or still-building publication fails quickly rather than being mislabeled ready.
  • Fresh provisioning starts with a building publication and promotes to complete only after a non-empty route set is staged.

Verification

  • npm run build
  • npm run test:cloudflare-runtime
  • npm run cloudflare:dry-run:d1
    • mutation bundle: 23,295.49 KiB raw / 8,371.96 KiB gzip
  • npm run cloudflare:dry-run:public-reader
    • reader bundle: 468.68 KiB raw / 115.52 KiB gzip
    • binding: R2 only
  • git diff --check origin/main...HEAD

No production deployment or mutation was performed.

Fixes #2112

AI Assistance

OpenCode with openai/gpt-5.6-terra produced the initial implementation through Homeboy Cook. OpenCode with openai/gpt-5.6-sol reviewed and corrected publication readiness, core-asset coverage, cache behavior, tests, and final verification. Chris Huber reviewed and directed the architecture and scope.

@chubes4
chubes4 merged commit 4a3ae64 into main Jul 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloudflare: isolate fast immutable public reads from the PHP-WASM mutation runtime

1 participant